package com.ruoyi.project.drug.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.project.drug.domain.DrugPurchase;
import com.ruoyi.project.drug.mapper.DrugPurchaseMapper;
import com.ruoyi.project.drug.service.IDrugPurchaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class DrugPurchaseServiceImpl implements IDrugPurchaseService {
    @Autowired
    private DrugPurchaseMapper drugPurchaseMapper;

    /**
     * 查询【采购信息】
     *
     * @param purId 【请填写功能名称】ID
     * @return 【请填写功能名称】
     */
    @Override
    public DrugPurchase selectDrugPurchaseById(String purId)
    {
        return drugPurchaseMapper.selectDrugPurchaseById(purId);
    }

    /**
     * 查询【采购信息】列表
     *
     * @param drugPurchase 【请填写功能名称】
     * @return 【请填写功能名称】
     */
    @Override
    public List<DrugPurchase> selectDrugPurchaseList(DrugPurchase drugPurchase)
    {
        return drugPurchaseMapper.selectDrugPurchaseList(drugPurchase);
    }

    /**
     * 新增【采购信息】
     *
     * @param drugPurchase 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int insertDrugPurchase(DrugPurchase drugPurchase)
    {
        drugPurchase.setCreateTime(DateUtils.getNowDate());
        return drugPurchaseMapper.insertDrugPurchase(drugPurchase);
    }

    /**
     * 修改【采购信息】
     *
     * @param drugPurchase 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateDrugPurchase(DrugPurchase drugPurchase)
    {
        drugPurchase.setUpdateTime(DateUtils.getNowDate());

        return drugPurchaseMapper.updateDrugPurchase(drugPurchase);

    }

    /**
     * 批量删除【采购信息】
     *
     * @param purIds 需要删除的【请填写功能名称】ID
     * @return 结果
     */
    @Override
    public int deleteDrugPurchaseByIds(String[] purIds)
    {
        return drugPurchaseMapper.deleteDrugPurchaseByIds(purIds);
    }

    /**
     * 删除【采购】信息
     *
     * @param purId 【请填写功能名称】ID
     * @return 结果
     */
    @Override
    public int deleteDrugPurchaseById(String purId)
    {
        return drugPurchaseMapper.deleteDrugPurchaseById(purId);
    }
}
